<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>
        <input type="text" name="keyword" placeholder="查找博客再要内容分类作者">
        <input type="button" value="查找" onclick="ptnDind">
        <input type="button" value="查找" onclick="ptnDind" id="headline">
        </div>
        <table id="td">
            <tr>
                <th>id</th>
                <th>标题</th>
                <th>摘要</th>
                <th>内容</th>
                <th>分类</th>
                <th>作者</th>
                <th>发表时间</th>
                <th>操作</th>
            </tr>
            <script src="./js/jquery-3.6.0.min.js"></script>
            <script src="./js/init.js"></script>

            <script>
                let tb = $('table');
                $(() => {
                    $.get('http://localhost:8080/blog', (res) => {
                        res.forEach(item => {
                            tb.append(`
                                <tr>
                                    <td>${item.id}</td>
                                    <td>${item.title}</td>
                                    <td>${item.digest}</td>
                                    <td>${item.text}</td>
                                    <td>${item.classify}</td>
                                    <td>${item.author}</td>
                                    <td>${item.updatedAt}</td>
                                    <td>
                                        <input type="button" value="修改" onclick="Update(${item.id})">
                                        <input type="button" value="删除" onclick="Delete(${item.id})">
                                    </td>
                                </tr>
                            `)
                        });
                    })
                })
            </script>
        </table>
</body>
</html>